3.1.59 \(\int \frac {\tan ^3(c+d x)}{a+a \sec (c+d x)} \, dx\) [59]

Optimal. Leaf size=28 \[ \frac {\log (\cos (c+d x))}{a d}+\frac {\sec (c+d x)}{a d} \]

[Out]

ln(cos(d*x+c))/a/d+sec(d*x+c)/a/d

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 28, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3964, 45} \begin {gather*} \frac {\sec (c+d x)}{a d}+\frac {\log (\cos (c+d x))}{a d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]^3/(a + a*Sec[c + d*x]),x]

[Out]

Log[Cos[c + d*x]]/(a*d) + Sec[c + d*x]/(a*d)

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 3964

Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_.), x_Symbol] :> Dist[1/(a^(m - n
- 1)*b^n*d), Subst[Int[(a - b*x)^((m - 1)/2)*((a + b*x)^((m - 1)/2 + n)/x^(m + n)), x], x, Sin[c + d*x]], x] /
; FreeQ[{a, b, c, d}, x] && IntegerQ[(m - 1)/2] && EqQ[a^2 - b^2, 0] && IntegerQ[n]

Rubi steps

\begin {align*} \int \frac {\tan ^3(c+d x)}{a+a \sec (c+d x)} \, dx &=-\frac {\text {Subst}\left (\int \frac {a-a x}{x^2} \, dx,x,\cos (c+d x)\right )}{a^2 d}\\ &=-\frac {\text {Subst}\left (\int \left (\frac {a}{x^2}-\frac {a}{x}\right ) \, dx,x,\cos (c+d x)\right )}{a^2 d}\\ &=\frac {\log (\cos (c+d x))}{a d}+\frac {\sec (c+d x)}{a d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.07, size = 21, normalized size = 0.75 \begin {gather*} \frac {\log (\cos (c+d x))+\sec (c+d x)}{a d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]^3/(a + a*Sec[c + d*x]),x]

[Out]

(Log[Cos[c + d*x]] + Sec[c + d*x])/(a*d)

________________________________________________________________________________________

Maple [A]
time = 0.06, size = 25, normalized size = 0.89

method result size
derivativedivides \(-\frac {-\sec \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )\right )}{d a}\) \(25\)
default \(-\frac {-\sec \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )\right )}{d a}\) \(25\)
risch \(-\frac {i x}{a}-\frac {2 i c}{a d}+\frac {2 \,{\mathrm e}^{i \left (d x +c \right )}}{d a \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{a d}\) \(68\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)^3/(a+a*sec(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

-1/d/a*(-sec(d*x+c)+ln(sec(d*x+c)))

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 28, normalized size = 1.00 \begin {gather*} \frac {\frac {\log \left (\cos \left (d x + c\right )\right )}{a} + \frac {1}{a \cos \left (d x + c\right )}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+a*sec(d*x+c)),x, algorithm="maxima")

[Out]

(log(cos(d*x + c))/a + 1/(a*cos(d*x + c)))/d

________________________________________________________________________________________

Fricas [A]
time = 2.91, size = 33, normalized size = 1.18 \begin {gather*} \frac {\cos \left (d x + c\right ) \log \left (-\cos \left (d x + c\right )\right ) + 1}{a d \cos \left (d x + c\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+a*sec(d*x+c)),x, algorithm="fricas")

[Out]

(cos(d*x + c)*log(-cos(d*x + c)) + 1)/(a*d*cos(d*x + c))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\tan ^{3}{\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)**3/(a+a*sec(d*x+c)),x)

[Out]

Integral(tan(c + d*x)**3/(sec(c + d*x) + 1), x)/a

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 111 vs. \(2 (28) = 56\).
time = 0.74, size = 111, normalized size = 3.96 \begin {gather*} -\frac {\frac {\log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1 \right |}\right )}{a} - \frac {\log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1 \right |}\right )}{a} + \frac {\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1}{a {\left (\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1\right )}}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+a*sec(d*x+c)),x, algorithm="giac")

[Out]

-(log(abs(-(cos(d*x + c) - 1)/(cos(d*x + c) + 1) + 1))/a - log(abs(-(cos(d*x + c) - 1)/(cos(d*x + c) + 1) - 1)
)/a + ((cos(d*x + c) - 1)/(cos(d*x + c) + 1) - 1)/(a*((cos(d*x + c) - 1)/(cos(d*x + c) + 1) + 1)))/d

________________________________________________________________________________________

Mupad [B]
time = 1.22, size = 44, normalized size = 1.57 \begin {gather*} \frac {2}{d\,\left (a-a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}-\frac {2\,\mathrm {atanh}\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}{a\,d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(c + d*x)^3/(a + a/cos(c + d*x)),x)

[Out]

2/(d*(a - a*tan(c/2 + (d*x)/2)^2)) - (2*atanh(tan(c/2 + (d*x)/2)^2))/(a*d)

________________________________________________________________________________________